<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<title>部署系统</title>
<head th:replace="common/incHead :: incHead"></head>
<body class="gray-bg">
<div class="ok-body">
    <div class="layui-row ljLayTableBox">
        <table class="layui-hide" id="indexTable" lay-filter="indexTable"></table>
    </div>
</div>
<div th:replace="common/incBottom :: incBottom"></div>
<script th:inline="javascript">
    /*<![CDATA[*/
    var indexData = [];
    /*[# th:each="item,itemStat:${systemList}"]*/
    indexData.push({
        id: [[${item.id}]],
        systemSort: [[${item.systemSort}]],
        systemCode: [[${item.systemCode}]],
        systemName: [[${item.systemName}]],
        systemHost: [[${item.systemHost}]] + ":" + [[${item.systemPort}]],
        systemUrl: [[${item.systemUrl}]],
        dataStatus: [[${item.dataStatus}]],
        createTime: [[${@lj.date(item.createTime)}]]
    });
    /*[/]*/
    /*]]>*/
</script>
<script th:inline="none">
    layui.use(["element", "jquery", "table", "okLayer", "okPapper"], function () {
        let table = layui.table;
        let okPapper = layui.okPapper;
        let $ = layui.jquery;
        okLoading.close($);
        let indexTable = table.render({
            elem: '#indexTable',
            data: indexData,
            height: 'full-46',
            page: false,
            toolbar: false,
            toolbar: "#toolbarTpl",
            defaultToolbar: [],
            even: true,
            size: "sm",
            cols: [[
                {field: "id", title: "系统ID", fixed: "left", width: 100, sort: true},
                {field: "systemCode", title: "系统编号", fixed: "left", width: 160},
                {field: "systemName", title: "系统名称", width: 160},
                {field: "systemSort", title: "系统排序", width: 100,},
                {field: "systemHost", title: "部署地址", minWidth: 200},
                {field: "systemUrl", title: "访问地址", minWidth: 200},
                {field: "dataStatus", title: "数据状态", width: 90, align: 'center', templet: "#DataStatusTpl"},
                {field: "createTime", title: "添加时间", width: 150},
                {title: "操作", width: 220, align: "center", fixed: "right", templet: "#operationTpl"}
            ]],
            done: function (res, curr, count) {
            }
        });
        okPapper.init();
    })
</script>
<!-- 头工具栏模板 -->
<script type="text/html" id="toolbarTpl">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm layui-btn-normal" title="添加系统" refTable="#indexTable" ljUrl="/sys/system/add" target="ljOpenSubmit" ljWidth="800px">
            <i class="layui-icon layui-icon-add-circle"></i>添加系统
        </button>
        <button class="layui-btn layui-btn-sm layui-btn-warm" title="一键编辑" refTable="#indexTable" ljUrl="/sys/system/editAll" target="ljOpenSubmit" ljWidth="800px">
            <i class="layui-icon layui-icon-upload-circle"></i>一键编辑
        </button>
        <button class="layui-btn layui-btn-sm layui-btn-danger" title="一键替换" refTable="#indexTable" ljUrl="/sys/system/replaceAll" ljWidth="600px" ljHeight="300px" target="ljOpenSubmit">
            <i class="layui-icon layui-icon-tips"></i>一键替换
        </button>
        <button class="layui-btn layui-btn-sm pull-right btnPageRefresh" style="margin-right: -120px;" lay-event="reload"><i class="layui-icon layui-icon-refresh"></i>页面刷新</button>
    </div>
</script>
<!-- 操作模板 -->
<div th:replace="common/operation :: pa_operation_default('SysSystem','系统','/sys/system','{{d.id}}')"></div>
<!-- 启用|停用模板 -->
<div th:replace="common/enum :: pa_enum_DataStatus"></div>
</body>
</html>